<html>
	<head></head>
		<title>Simple JSP example</title>
	<body>
		<h1>Image Transform Login</h1>
		<b>Signed in as:</b> <%= request.getSession().getAttribute("login")%><br>
		<br>
		
		<% 
			String addedImage = (String)request.getSession().getAttribute( "addedImage" );
			if( addedImage == "true" ) {
		%>
				Last added image: <%=request.getSession().getAttribute("lastAdded")%> <br>
		<%
			}
			//reset stuff
			addedImage = "false";
			request.getSession().setAttribute( "addedImage", addedImage );
			request.setAttribute("userimages", null);
			
		%>
		
		<b>User Menu</b>
		<ul>			
			<li><a href='ViewImages'>View Images</a></li>
        	<li><a href='SessionLogout'>Logout</a></li>
        </ul> 
        
        <hr>
        <b>Upload a new image</b>
		<form action="/ece1779/servlet/FileUpload"  enctype="multipart/form-data" method="post">
			<input type="hidden" name="userID" 
				value ="<%= request.getSession().getAttribute("userIdddd")%>"><br />
   			What is the image files to upload? <input type="file" name="theFile"><br />
   			<input type="submit" value="Send">
			<input type="reset">
		</form>
		
		<br>
		<hr>
	<!--
		
		<b>Your current images:</b>
		
		<br> Username is:
		<%= (String)this.getServletContext().getAttribute("login")%>
		<br> Password is:
		<%= (String)this.getServletContext().getAttribute("password")%>
		<!-- %= request.getParameter("password")%-->
		<br> UserId is:
		<%= this.getServletContext().getAttribute("userIdddd")%>
		<!--%= request.getSession().getAttribute("userId")%-->
		
	-->
	</body>
</html>


